#include "StdAfx.h"
#include "DevManager.h"

CDevManager* CDevManager::s_DevManager = 0;

CDevManager::CDevManager(void): m_localStation(0)
{
}

CDevManager::~CDevManager(void)
{
    if (m_localStation)
        delete m_localStation;

    std::list<CStation*>::iterator it = m_DownStations.begin();
    for (; it != m_DownStations.end(); it++){
        delete *it;
    }
    it = m_UpStations.begin();
    for (; it != m_UpStations.end(); it++){
        delete *it;
    }
}

CDevManager* CDevManager::instance(){
    if (!s_DevManager){
        s_DevManager = new CDevManager();
    }

    return s_DevManager;
}


void CDevManager::setLocalStation(CStation* station){
    if (station){
        m_localStation = station;
    }
    return;
}

void CDevManager::addDownStation(CStation* station){
    if (station){
        m_DownStations.push_back(station);
    }
    return;
}

void CDevManager::addUpStation(CStation* station){
    if (station){
        m_UpStations.push_back(station);
    }
    return;
}




